home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / MATH / RANDOMGN / RANDOMGN.DOC < prev    next >
Text File  |  1991-06-28  |  2KB  |  32 lines

  1. RANDOMGN is a set a programs to generate and make available random
  2. numbers.  It consists of a TSR (RANTSR) which measures the time interval
  3. between keyboard interrupts (in units of approximately 4 microseconds)
  4. mod 256, and a sample program (APPRAND) to access the list of random bytes
  5. and build a file of random bytes.
  6.  
  7. The TSR maintains a circular buffer of random numbers.  After the TSR is
  8.   loaded, it hooks to the multiplex interrupt.  To obtain n random numbers,
  9.   set al=n ; ah=aeh ; dx = 726eh ; es:di=buffer address for the numbers
  10.   INT 2F
  11.   Returns with al=ffh (success) or al=00 (not all n values returned)
  12.   dx = number of values returned
  13.   all other registers unchanged
  14. The TSR stores one random byte every time the keyboard interrupt (INT9)
  15.   is activated.  The byte is bits 9-2 of the current Timer 0 value.
  16. Note that n=0 can be used to determine whether or not the TSR has been
  17.   loaded
  18. The source of the TSR is in RANTSR.ASM, and the TSR com file is RANTSR.COM.
  19.  
  20. APPRAND illustrates how to interface to the TSR.  The program accesses
  21. the random byte list, and appends the bytes to the file RANDOM.LOG.  The
  22. turbo pascal source is in APPRAND.PAS, and the executable is in APPRAND.EXE.
  23.  
  24. If anyone does a statistical analysis of the quality of this random
  25. number generator, I would be very interested.
  26.  
  27. Written by Joseph R Ahlgren, BBS 703-241-7980, CompuServe 70461,2340
  28.   This program is freeware.  It may be used without restriction, provided
  29.   the original source is acknowledged.
  30.   91/06/28
  31.  
  32.